/**
 * 流程权限
 */
layui.config({
  base: '/'
}).extend({
  flying: 'flying'
}).define(['index', 'flying'], function (exports) {  //先加载index模块，里面配置了全局的入口
  let admin = layui.admin;
  let flying = layui.flying;
  let form = layui.form;
  let table = layui.table;

  flying.table({
    elem: '#LAY-identity-table',
    url: '/process/getProcessDefinitionLatestVersionPageList', //数据接口
    cols: [
      {type: 'checkbox', fixed: 'left'}
      , {type: 'numbers', fixed: 'left', title: '序号'}
      , {field: 'id', title: '流程定义ID', minWidth: 120}
      , {field: 'key', title: '流程定义KEY', minWidth: 100}
      , {field: 'name', title: '流程名称', minWidth: 100}
      , {field: 'suspended', title: '状态', minWidth: 80, templet: function (d) {
          if (d.suspended == false) {
            return '<span class="layui-bg-blue layui-badge-rim">激活</span>';
          } else if (d.suspended == true) {
            return '<span class="layui-badge layui-badge-rim">挂起</span>';
          } else {
            return '';
          }
        }, unresize: true}
      , {field: 'version', title: '版本号', minWidth: 50, unresize: true}
      , {field: 'tenantId', title: '租户号', minWidth: 90}
    ]
  });


  //对外暴露的接口
  exports('identity', {});
});

